/*
 * @Author: liming-pan
 * @Date: 2022-01-29 20:47:28
 * @LastEditors: liming-pan
 */
import request from './request'
export const getUsers = (params) => {
  return request({
    url: '/users',
    params
  })
}

export const changeUserState = (uid, type) => {
  return request({
    url: `users/${uid}/state/${type}`,
    method: 'put'
  })
}

export const addUser = (data) => {
  return request({
    url: '/users',
    method: 'POST',
    data
  })
}

export const editUser = (data) => {
  return request({
    url: `/users/${data.id}`,
    method: 'PUT',
    data
  })
}

export const deleteUser = (id) => {
  return request({
    url: `/users/${id}`,
    method: 'DELETE'
  })
}
